package asteroids.model.programs.statement;

import java.util.ArrayList;
import java.util.Map;

import asteroids.model.programs.expression.*;
import asteroids.model.programs.type.*;

public abstract class S {
	
	private int line;
	private int column;
	private boolean executed;
	
	public S(int line, int column){
		this.line = line;
		this.column = column;
		executed = false;
	}
	
	public int getLine(){
		return line;
	}
	
	public int getColumn(){
		return column;
	}
	
	public boolean getExecuted(){
		return executed;
	}
	
	public abstract void execute(T type);
	
	public abstract boolean hasSteps();
	
	public boolean hasBeenExecuted(){
		return executed;
	}
	
	public void setExecuted(boolean b){
		executed = b;
	}
	
	public S getNextStatement(){
		return this;
	}
	public boolean isAssignment(){
		return false;
	}
	
	public boolean isAction(){
		return false;
	}
	
	public boolean isForEach(){
		return false;
	}
	
	public abstract ArrayList<E> getExpressions();
	
	public ArrayList<VariableExpression> getVariableExpressions(){
		return new ArrayList<VariableExpression>();
	}
	
	public S getFirstStatement(){
		return this;
	}
	
	public S getLastStatement(){
		return this;
	}

	public abstract String typecheck(Map<String, T> globals);
	
	public abstract boolean hasAction();
}
